home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / windows / wb32_96a.zip / FILESIZE.WB_ < prev    next >
Text File  |  1996-01-05  |  2KB  |  67 lines

  1.    
  2. ;DIRSIZE
  3. ;This file traverses the directory tree and computes the total
  4. ;size of all files on the drive.
  5. ;
  6.         IntControl(29,@tab,0,0,0)    ; Standardize on tabs for file/dir delimiters
  7.         DirChange("C:\")
  8.         BoxOpen("File Size Inspector","Reading Initial Directories")
  9.         tot = FileSize(FileItemize("*.*"))
  10.         sub1 = DirItemize("*.*")
  11.         totdir=0
  12.         level=1
  13.         dir1=DirGet()
  14.         numdir1 = ItemCount(sub1, @tab)
  15.         index1 = 0
  16.   
  17.         :dsloop
  18.         If index%level% == numdir%level% Then Goto upalevel
  19.         index%level% = index%level% + 1
  20.         DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, @tab)))
  21.         BoxText(strcat("Level=",level,@crlf,"Total=",tot,@crlf,dir%level%))
  22.         totdir=totdir+1
  23.         tot = tot + FileSize(FileItemize("*.*"))
  24.         level = level + 1
  25.         dir%level% = DirGet()
  26.         sub%level% = DirItemize("*.*")
  27.         numdir%level% = ItemCount(sub%level%, @tab)
  28.         index%level% = 0
  29.         goto dsloop
  30.   
  31.         :upalevel
  32.         drop(dir%level%,sub%level%,index%level%,numdir%level%)
  33.         level=level-1
  34.         if level!=0 then goto dsloop
  35.  
  36.         ; -----------
  37.         ; Termination
  38.         ; -----------
  39.         BoxShut()
  40.         If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  41.         tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  42.         tot = StrTrim(tot)
  43.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  44.         tot = StrTrim(tot)
  45.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  46.         tot = StrTrim(tot)
  47.         Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
  48.         Exit
  49.    
  50.    
  51.    
  52.    
  53.    
  54.    
  55.    
  56.    
  57.    
  58.    
  59.    
  60.    
  61.    
  62.    
  63.    
  64.    
  65.    
  66.    
  67.